﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyManager.Business
{
    public class Task : IEquatable<Task>

    {


        public Task()
        {
            this._id = string.Empty;
            this._title = string.Empty;
            this._description = string.Empty;
            this._categoryIds = new StringCollection();
            this._status = TaskStatus.Open;
            
            
        }

        #region "Properties"
        private string _id;

        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _title;

        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }
            

        private string _description;

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        private DateTime _createdDate;

        public DateTime CreatedDate
        {
            get { return _createdDate; }
            set { _createdDate = value; }
        }

        private DateTime _startDate;

        public DateTime StartDate
        {
            get { return _startDate; }
            set { _startDate = value; }
        }

        private DateTime _dueDate;

        public DateTime DueDate
        {
            get { return _dueDate; }
            set { _dueDate = value; }
        }

       
       

        public Task(string taskId)
        {
            // TODO: Complete member initialization
            this.Id = taskId;
        }

       

        private StringCollection _categoryIds;

        public StringCollection CategoryIds
        {
            get { return _categoryIds; }
            set { _categoryIds = value; }
        }
        


        private TaskStatus _status;

        public TaskStatus Status
        {
            get { return _status; }
            set { _status = value; }
        }
            
        
        //TODO: mode to be added

        //TODO: Reminder properties to be added


        #endregion 


        public override string ToString()
        {
            return this._title;
        }



        public bool Equals(Task other)
        {
            if (this.Id == other.Id) return true;
            return false;
        }

        public override int GetHashCode()
        {
            int hasForId = this.Id == null ? 0 : this.Id.GetHashCode();
            return hasForId;
        }
    }
}
